Integrand size = 23, antiderivative size = 81 \[ \int \frac {3+3 \sin (e+f x)}{(c+d \sin (e+f x))^2} \, dx=\frac {6 \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{(c+d) \sqrt {c^2-d^2} f}-\frac {3 \cos (e+f x)}{(c+d) f (c+d \sin (e+f x))} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.02, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {2833, 12, 2739, 632, 210} \[ \int \frac {3+3 \sin (e+f x)}{(c+d \sin (e+f x))^2} \, dx=\frac {2 a \arctan \left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{f (c+d) \sqrt {c^2-d^2}}-\frac {a \cos (e+f x)}{f (c+d) (c+d \sin (e+f x))} \]
[In]
[Out]
Rule 12
Rule 210
Rule 632
Rule 2739
Rule 2833
Rubi steps \begin{align*} \text {integral}& = -\frac {a \cos (e+f x)}{(c+d) f (c+d \sin (e+f x))}-\frac {\int \frac {a (c-d)}{c+d \sin (e+f x)} \, dx}{-c^2+d^2} \\ & = -\frac {a \cos (e+f x)}{(c+d) f (c+d \sin (e+f x))}+\frac {a \int \frac {1}{c+d \sin (e+f x)} \, dx}{c+d} \\ & = -\frac {a \cos (e+f x)}{(c+d) f (c+d \sin (e+f x))}+\frac {(2 a) \text {Subst}\left (\int \frac {1}{c+2 d x+c x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{(c+d) f} \\ & = -\frac {a \cos (e+f x)}{(c+d) f (c+d \sin (e+f x))}-\frac {(4 a) \text {Subst}\left (\int \frac {1}{-4 \left (c^2-d^2\right )-x^2} \, dx,x,2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{(c+d) f} \\ & = \frac {2 a \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{(c+d) \sqrt {c^2-d^2} f}-\frac {a \cos (e+f x)}{(c+d) f (c+d \sin (e+f x))} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.96 (sec) , antiderivative size = 219, normalized size of antiderivative = 2.70 \[ \int \frac {3+3 \sin (e+f x)}{(c+d \sin (e+f x))^2} \, dx=\frac {3 (1+\sin (e+f x)) \left (2 \sqrt {c^2-d^2} \csc (e) \sqrt {(\cos (e)-i \sin (e))^2} (c \cos (e)+d \sin (f x))+4 d \arctan \left (\frac {\sec \left (\frac {f x}{2}\right ) (\cos (e)-i \sin (e)) \left (d \cos \left (e+\frac {f x}{2}\right )+c \sin \left (\frac {f x}{2}\right )\right )}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}\right ) (\cos (e)-i \sin (e)) (c+d \sin (e+f x))\right )}{2 d (c+d) \sqrt {c^2-d^2} f \sqrt {(\cos (e)-i \sin (e))^2} \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2 (c+d \sin (e+f x))} \]
[In]
[Out]
Time = 0.65 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.40
method | result | size |
derivativedivides | \(\frac {2 a \left (\frac {-\frac {d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (c +d \right ) c}-\frac {1}{c +d}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) c +2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c}+\frac {\arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c +d \right ) \sqrt {c^{2}-d^{2}}}\right )}{f}\) | \(113\) |
default | \(\frac {2 a \left (\frac {-\frac {d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (c +d \right ) c}-\frac {1}{c +d}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) c +2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c}+\frac {\arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c +d \right ) \sqrt {c^{2}-d^{2}}}\right )}{f}\) | \(113\) |
risch | \(-\frac {2 a \left (i d +c \,{\mathrm e}^{i \left (f x +e \right )}\right )}{d \left (c +d \right ) f \left (d \,{\mathrm e}^{2 i \left (f x +e \right )}-d +2 i c \,{\mathrm e}^{i \left (f x +e \right )}\right )}-\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}-c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right )}{\sqrt {-c^{2}+d^{2}}\, \left (c +d \right ) f}+\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}+c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right )}{\sqrt {-c^{2}+d^{2}}\, \left (c +d \right ) f}\) | \(205\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 362, normalized size of antiderivative = 4.47 \[ \int \frac {3+3 \sin (e+f x)}{(c+d \sin (e+f x))^2} \, dx=\left [-\frac {{\left (a d \sin \left (f x + e\right ) + a c\right )} \sqrt {-c^{2} + d^{2}} \log \left (\frac {{\left (2 \, c^{2} - d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2} + 2 \, {\left (c \cos \left (f x + e\right ) \sin \left (f x + e\right ) + d \cos \left (f x + e\right )\right )} \sqrt {-c^{2} + d^{2}}}{d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2}}\right ) + 2 \, {\left (a c^{2} - a d^{2}\right )} \cos \left (f x + e\right )}{2 \, {\left ({\left (c^{3} d + c^{2} d^{2} - c d^{3} - d^{4}\right )} f \sin \left (f x + e\right ) + {\left (c^{4} + c^{3} d - c^{2} d^{2} - c d^{3}\right )} f\right )}}, -\frac {{\left (a d \sin \left (f x + e\right ) + a c\right )} \sqrt {c^{2} - d^{2}} \arctan \left (-\frac {c \sin \left (f x + e\right ) + d}{\sqrt {c^{2} - d^{2}} \cos \left (f x + e\right )}\right ) + {\left (a c^{2} - a d^{2}\right )} \cos \left (f x + e\right )}{{\left (c^{3} d + c^{2} d^{2} - c d^{3} - d^{4}\right )} f \sin \left (f x + e\right ) + {\left (c^{4} + c^{3} d - c^{2} d^{2} - c d^{3}\right )} f}\right ] \]
[In]
[Out]
Timed out. \[ \int \frac {3+3 \sin (e+f x)}{(c+d \sin (e+f x))^2} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {3+3 \sin (e+f x)}{(c+d \sin (e+f x))^2} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.53 \[ \int \frac {3+3 \sin (e+f x)}{(c+d \sin (e+f x))^2} \, dx=\frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (c\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )} a}{\sqrt {c^{2} - d^{2}} {\left (c + d\right )}} - \frac {a d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a c}{{\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + c\right )} {\left (c^{2} + c d\right )}}\right )}}{f} \]
[In]
[Out]
Time = 7.22 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.73 \[ \int \frac {3+3 \sin (e+f x)}{(c+d \sin (e+f x))^2} \, dx=\frac {2\,a\,\mathrm {atan}\left (\frac {\left (c+d\right )\,\left (\frac {2\,a\,\left (d^2+c\,d\right )}{{\left (c+d\right )}^{5/2}\,\sqrt {c-d}}+\frac {2\,a\,c\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{{\left (c+d\right )}^{3/2}\,\sqrt {c-d}}\right )}{2\,a}\right )}{f\,{\left (c+d\right )}^{3/2}\,\sqrt {c-d}}-\frac {\frac {2\,a}{c+d}+\frac {2\,a\,d\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{c\,\left (c+d\right )}}{f\,\left (c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+2\,d\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\right )} \]
[In]
[Out]